home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / telecomm / uemail.arc / UEMAIL.KEY < prev    next >
Encoding:
Text File  |  1987-01-19  |  21.2 KB  |  427 lines

  1.                                Time: 10:36:56 am
  2.                                    Uemail
  3.  
  4. Uemail is an emacs-like full-screen editor for the Atari-ST computer
  5. equipped with a color monitor.  It supports all of the major commands
  6. offered by microEmacs version 30, plus some extensions that make its
  7. interface closer to that used by GNU_EMACS.  In fact, uemail is designed to
  8. work in tandem with GNU_EMACS on a remote computer. When the program is
  9. connected to the serial line, all of the function keys and the number pad
  10. keys send the same commands as they do from within uemail, and the defined
  11. keyboard macros (macros triggered by the accent grave key) are also sent
  12. accross the line. This allows you to set up special function key definition
  13. files and macro definition files to use with a remote emacs.  In addition
  14. to the emacs editing commands, uemail has a complete terminal connect mode
  15. which supports kermit protocol for 7-bit transfers between two computers.
  16. This ability allows the editor to work with text from a remote system and
  17. to transfer it back to that system when done.  For remotes that do not
  18. support the kermit protocol there are log and transfer commands which use
  19. the ST's flow control (settable from within the terminal mode) to transfer
  20. text without dropping characters (provided that the remote supports one of
  21. the ST's handshaking protocols).  For those who do not use the EMULATOR.ACC
  22. desk accessory, uemail will set the baud rate while in connect mode.  At
  23. the beginning of the connect session, the baud rate defaults to 1200 bps,
  24. but it can be reset to 300, 9600, or 19200 bps.  When uemail exits from
  25. terminal mode, it saves the terminal screen. When it returns to terminal
  26. mode, it rewrites that screen placing the cursor at its previous position.
  27.  
  28. For the text editor programmer, uemail has a built-in write macro command
  29. which translates uemail keyboard macros into C source code, allowing quick
  30. prototyping of new functions to be added to the program.  Additional macro
  31. commands store, save, and recover keyboard macros in their keycode form,
  32. allowing the user to design macro files by simply recording keystrokes for
  33. functions.  For programmers uemail provides a basic `cc' command designed
  34. to drive the Alcyon C compiler and the DRI linker/loader.  The files
  35. shell.c and emcc.c contain the code for cc and for the shell command, which
  36. let you run TOS applications from within the editor. The cc command expects
  37. for drive M: to be a temporary ram disk and drive E: to contain source. 
  38. These assumptions are hardwired into the source.  However, if the file
  39. cc.ini exists on the default drive when uemail starts up, the program will
  40. read that file and install its values for the source, include, temporary,
  41. symbols, and compiler directories.  Alternatively, the user can load a
  42. command file after the editor has started.  The following is a sample
  43. cc.ini file:
  44.  
  45. /* cc.ini file for cc.ttp and uemail.ttp */
  46. source=e:\            /* C, lnk, and 68K files    */
  47. include=d:\stdlib.h\        /* headers    */
  48. temp=m:\            /* temporary files, o files, and final prg  */
  49. symb=c:\bin\            /* as68symb.dat    */
  50. bin=c:\bin\            /* compilers, assembler, linker, and loader */
  51. tdrive=m            /* temp drive drive designation    */
  52. home=c:\uemail\            /* where it all began    */
  53. root=c:\            /* boot directory    */
  54. assembly=d:\assembly.s\        /* assembly sources    */
  55. etc=c:\util\            /* utility programs    */
  56. comm=c:\comm\            /* communications    */
  57. shell=c:\util\pcommand.prg    /* shell program    */
  58. syslib=c:\bin\            /* library directory    */
  59. lnkfile=xemacs            /* filename of link command file    */
  60. float=                /* flag for floating point -f, -e or nil*/
  61. dolink=1            /* if 1, call linker after compiling file[s] */
  62. delete=1            /* delete I, S, 68K files? 1==YES    */
  63. /* function key bindings for uemail.ttp */
  64. F1=setmark            /* sets the mark */
  65. F2=listbuffers            /* lists current buffers */
  66. F3=filename            /* change current filename */
  67. F4=writeregion            /* write text between point and mark to file */
  68. F5=fileinsert            /* insert file at point */
  69. F6=fileread            /* read file into current buffer */
  70. F7=filevisit            /* visit (find) a file */
  71. F8=filewrite            /* write out buffer to named file */
  72. F9=filesave            /* save current buffer if changed */
  73. F10=quickexit            /* save all changed buffers and exit */
  74. /* Number pad bindings for uemail.ttp */
  75. N(=backword            /* backward word */
  76. N)=forwword            /* forward word */
  77. N/=grtw                /* globally remove trailing whitespace */
  78. N*=retversion            /* return current version to message line */
  79. N7=gotobol            /* goto beginning of line */
  80. N8=gotoeol            /* goto end of line */
  81. N9=unkncom            /* unknown command */
  82. N-=pageback            /* back by one text page (60 lines default) */
  83. N4=backsent            /* goto beginning of sentence */
  84. N5=forwsent            /* goto end of sentence */
  85. N6=unkncom            /* unknown */
  86. N+=pageforw            /* forward by one text page */
  87. N1=gotbop            /* goto beginning of paragraph (blank line) */
  88. N2=goteop            /* goto end of paragraph (blank line) */
  89. N3=unkncom            /* unknown */
  90. N.=forwdel            /* delete character under cursor */
  91. NENTER=indent            /* newline and indent */
  92.  
  93. The cc.ini file is read at startup, but the values can be changed after
  94. initialization using the commfil command (CTLX-CTRL-E).  Each line must be
  95. formatted as above.  The word before the equal sign is the `alias' name
  96. used by the program, and the line to the left of the equal sign is the
  97. actual path name assigned to the aliased variable.  There can be no
  98. embedded blanks or tabs in a name or alias, but comments may appear on any
  99. line as long as there is at least one space or tab character between the
  100. end of the path and the beginning of the comment.  No special comment
  101. characters are necessary although using standard comment markers like those
  102. above help to make the comments more readable.  The order of definitions is
  103. unimportant, and blank or extra lines are ignored as are aliasses for which
  104. there are no internal matches to be found (this is what allows both the
  105. cc.prg and uemail to use the same startup file without problems).
  106.  
  107. Typing `cc' after issuing the shell command (CTRL-C) and the filename at
  108. the command line prompt invokes the compiler.  To compile the file
  109. e:test.c, you simply type test at the command line prompt.  The output file
  110. will be on drive M:. If the variable dolink equals 1, then the linker will
  111. be loaded and told to get its command from the file defined by linkfile. 
  112. (The linkfile must be on the source directory and must have an .LNK extent;
  113. additionally, because the link68 program cannot handle filenames longer
  114. than 13 letters, including the path and drive, your filename plus source
  115. directory should be no more than 9 characters long.)
  116.  
  117. The set path command and all the file commands also use the alias table. If
  118. at the command's prompt you type a line which begins with a `~', these
  119. commands look up the word after the ~ and test it against the known
  120. aliases.  If the word match matches a known alias, the string associated
  121. with that alias is copied into the filename.  Thus if "temp=c:\files\temp"
  122. is in the cc.ini file at startup, typing the read file command ^X^R and
  123. asking for the file ~temp\test.i will read in the file c:\files\temp\test.i
  124. (note that the `\' character is necessary, and the `~' must be the first
  125. character on the line).
  126.  
  127. Uemail also supports writers.  In addition to the useful macro function,
  128. uemail provides sentence, paragraph, and page movement commands.  It
  129. provides two punctuation movement commands, forward to next punctation and
  130. backward to previous puntuation, useful for moving to the next comma or
  131. quotation mark in a text.  Uemail extends the usual microemacs on-screen
  132. editing features, adding an indent column with the ability to define an
  133. indent prefix.  Unlike other versions of microemacs, uemail's fill
  134. paragraph command leaves the cursor inside the paragraph in the same spot
  135. where it was when the command was issued.  There are line-based commands for
  136. formatting texts.  The flushleft, flushright, center, transpose words, and
  137. globally delete trailing whitespace all deal with text appearance.  The
  138. indent subsequent newline same as this lets you open a line underneath the
  139. present line with the same indentation without having to be at the end of
  140. the present line.  The drop line and indent command works similarly but
  141. inserts the new line above the present line.  Both of these functions are
  142. not only useful for formatting text, but also for indenting program code.
  143.  
  144. Uemail provides a rudimentary interface for a spelling checker.  If your
  145. spelling checker uses the standard spell correction mark (0x93), the
  146. program will search for that character in your file when you type the go
  147. spell command (CTLX-S), placing your cursor at the beginning of the word to
  148. correct. The program has a word count function which reports the average
  149. size of words in a buffer.  This function reports the length of your buffer
  150. in letters and characters.  It uses the letter total to determine averages.
  151. This leads to a more accurate average than methods which divide the total
  152. number of characters in a buffer by the total number of words.
  153.  
  154. Uemail can print buffers with page numbers, two header lines, and single or
  155. double spacing.  The page size is settable, and the internal code
  156. automatically sets up any Diablo/Xerox compatible printer for standard 12
  157. pitch type.  The program can print while editing (as long as there is
  158. keyboard activity), and if you try to exit while printing, uemail will ask
  159. whether you want to exit for sure.  
  160.  
  161. Unlike most microEmacsen, uemail follows the GNU_EMACS convention of
  162. writing all `dirty' buffers when exitting.  If a normal exit is chosen
  163. (CTLX-CTRL-C) and no argument is given, the program asks the user whether
  164. individual modified files should be saved.  The quick exit command (CTRL-Z)
  165. saves every modified buffer without asking.  The ST is prone to BUS and
  166. address errors, uemail tries to protect the user from these by intercepting
  167. the vectors associated with these exceptions. When the code signals an
  168. error, the program gives you the opportunity to save your files before
  169. restoring the system and exiting.  This can avoid a lot of frustration.
  170.  
  171. The following list of commands is arranged according to category.  The
  172. column marked KEY shows the keystrokes bound to the command.  The column
  173. marked COMMAND gives the internal name of the command that uemail uses. 
  174. And the DESCRIPTION gives a brief explanation of what the command does.  In
  175. the chart, the ^ character in front of a letter means that letter is a
  176. control character; ESC is the escape key, and ` is the accent grave.  Any
  177. ESC sequence that uses a simple alphabetic key as the second argument is
  178. reachable using the ALT key while typing the alpha key.  For example both
  179. ESC-F and ALT-F move forward one word.  The difference between the two
  180. options is that the ESC version requires typing two keys, while the ALT
  181. version requires one "shifted" keystroke.  Some of the commands below react
  182. differently depending upon whether the function is passed a numeric
  183. argument.  Numeric arguments are used most often to cause commands to
  184. repeat a set number of times.  There are two ways to signify an argument to
  185. a function.  Each method requires typing a repeat command before typing the
  186. function.  The two repeat commands are CTRL-U and the ESC key followed by
  187. any digit or by the negative sign.  CTRL-U is called the universal prefix
  188. and always defaults to four repeats.  Typing CTRL-U repeatedly multiplies
  189. the repeat count.  The count echos to the message line.  Typing ESC
  190. followed by a number does essentially the same thing but allows you to
  191. choose the number directly.  For example: ESC-2 followed by CTRL-K deletes
  192. two full lines forward, which is equivalent to deleting a line and the
  193. trailing newline.  Some commands look for zero arguments to change their
  194. normal actions.  For example: CTLX-D is the set path command; however, when
  195. it is prefaced with ESC-0 or CTRL-U-0, it returns the current default drive
  196. and path to the message line.  The showtime command is similar.  If it is
  197. called normally, without an argument, or if it is called with a zero or
  198. negative argument, it writes the current time to the message line.  If it
  199. is called with a possitive argument less than 1000 (a special case), it
  200. writes the time into the document at the current position.  The 1000 value
  201. is used by the kermit section to write to the message line.  Since the
  202. kermit section must use a different message writing scheme from that used
  203. by the editor.
  204.  
  205. Commands for Uemail
  206. ===================
  207. KEY (lower case OK)    COMMAND            DESCRIPTION
  208. --------------------------------------------------------------------------
  209. MISCELLANEOUS UTILITIES
  210. ESC-~        clearflag();        /* Clear changed buffer flag    */
  211. ^X-~ or ^C    shell();        /* run a child process or cc    */
  212. ^Q        quote();        /* Insert literal        */
  213. ^G        ctrlg();        /* Abort out of things        */
  214. ^X-^C        quit();            /* Quit    prompt to save files    */
  215. ^Z        quickexit();        /* low keystroke style exit and save.*/
  216. ^X-=        showcpos();        /* Show the cursor position    */
  217. ^X-W        wc();            /* word and line count of buffer */
  218. ^X-*        retversion();        /* version date */
  219. ^X-M        setmode();        /* set a mode for a buffer */
  220. ^X-^T        showtime();        /* tell the time or insert in buffer */
  221. ESC-M        sglmode();        /* set global mode    */
  222. ESC-X        mdoncom();        /* do named command    */
  223. ESC-@        rettpa();        /* show available memory and usage */
  224. ESC-^N        enumerate();        /* start or incr. counter variable */
  225. Lots-o-keys    unkncom();        /* unknown command BEEP */
  226.  
  227. FILE OPERATIONS
  228. ^X-^E        commfill();        /* Read a cc.ini command file    */
  229. ^X-I        fileinsert();        /* Insert existing file at point*/
  230. ^X-^R        fileread();        /* Get a file, into existing buf*/
  231. ^X-^V        filevisit();        /* Get a file, new buffer    */
  232. ^X-^W        filewrite();        /* Write a file            */
  233. ^X-^S        filesave();        /* Save current file        */
  234. ^X-^F        filename();        /* Change file name        */
  235. ^X-D        setpath();        /* set path if arg=0 get path    */
  236.  
  237. CURSOR MOVEMENT
  238. ^A        gotobol();        /* Move to start of line or prev*/
  239. ^E        gotoeol();        /* Move to end of line or next    */
  240. ^B        backchar();        /* Move backward by characters    */
  241. ^F        forwchar();        /* Move forward by characters    */
  242. ^P        backline();        /* Move backward by lines    */
  243. ^N        forwline();        /* Move forward by lines    */
  244. ESC-V        backpage();        /* Move backward by screens    */
  245. ^V        forwpage();        /* Move forward by screens    */
  246. ESC-B or ESC-^B    backword();        /* Backup by words        */
  247. ESC-F or ESC-^F    forwword();        /* Advance by words        */
  248. ESC-N        goteop();        /* goto end of paragraph */
  249. ESC-P        gotbop();        /* goto beginning of paragraph */
  250. ^X-<        btopunct();        /* move backward to last punctuation */
  251. ^X->        ftopunct();        /* move forward to next punctuation */
  252. ESC-A        backsent();        /* backward to beginning of sentence */
  253. ESC-E        forwsent();        /* forward to end of sentence */
  254. ESC-, or ESC-<    gotobob();        /* Move to start of buffer    */
  255. ESC-. or ESC->    gotoeob();        /* Move to end of buffer    */
  256. ESC-G        goline();        /* goto line in text (use arg) */
  257. ^@ or ESC-SP    setmark();        /* Set mark            */
  258. ^X-^X        swapmark();        /* Swap "." and mark        */
  259.  
  260. DOCUMENT FORMATTING
  261. ^X-#        setpage();        /* set page size from arg */
  262. ^X-!        paginate();        /* insert '\f' every page */
  263. ^X-+        pageforw();        /* move forward set page length */
  264. ^X-- (dash)    pageback();        /* move back set page length */
  265. ^X-TAB        print();        /* print buffer with heading */
  266. ^X-F        setfillcol();        /* Set fill column.        */
  267. ESC-Q        fillpar();        /* fill paragraph to fill column */
  268. ^X-.        setindcol();        /* Set indent column or prefix    */
  269. ^T        twiddle();        /* Twiddle characters        */
  270. ESC-T        twaddle();        /* transpaose two words in place */
  271. TAB        tab();            /* Insert tab            */
  272. RETURN        newline();        /* Insert CR-LF            */
  273. ^J        indent();        /* Insert CR-LF, then indent    */
  274. ^O        openline();        /* Open up a blank line        */
  275. ^X-^O        deblank();        /* Delete blank lines        */
  276. ESC-O        mdropln();        /* drop current line and move up*/
  277. ESC-J        mindnl();        /* indent subsequent NL same as this */
  278. ESC-\        mdelind();        /* delete beginning line indentation */
  279. ESC-^R        mrflush();        /* flush right current line */
  280. ESC-^C        mcenter();        /* center current line */
  281. ^X-\        grtw();            /* remove trailing white space */
  282. ESC-^O        clowsp();        /* close up intervening white space */
  283. ESC-^P        tglcase();        /* toggle case of letter at point */
  284.  
  285. BUFFERS AND WINDOWS
  286. ^X-^B        listbuffers();        /* Display list of buffers    */
  287. ^X-B        usebuffer();        /* Switch a window to a buffer    */
  288. ^X-K        killbuffer();        /* Make a buffer go away.    */
  289. ESC-!        reposition();        /* Reposition window        */
  290. ^L        refresh();        /* Refresh the screen        */
  291. ^X-^N        mvdnwind();        /* Scroll window down        */
  292. ^X-^P        mvupwind();        /* Scroll window up        */
  293. ^X-N        nextwind();        /* Move to the next window    */
  294. ^X-P or ^X-O    prevwind();        /* Move to the previous window    */
  295. ^X-1        onlywind();        /* Make current window only one    */
  296. ^X-2        splitwind();        /* Split current window        */
  297. ^X-Z        enlargewind();        /* Enlarge display window.    */
  298. ^X-^Z        shrinkwind();        /* Shrink window.        */
  299.  
  300. DELETION AND REGIONS
  301. ESC-H        markpar();        /* mark paragraph sets mark */
  302. ^D        forwdel();        /* Forward delete        */
  303. DEL        backdel();        /* Backward delete        */
  304. ESC-TAB        kill();            /* Kill line forward            */
  305. ^Y        yank();            /* Yank back from killbuffer.    */
  306. ESC-U        upperword();        /* Upper case word.        */
  307. ESC-L        lowerword();        /* Lower case word.        */
  308. ^X-^L        upperregion();        /* Upper case region.        */
  309. ^X-^U        lowerregion();        /* Lower case region.        */
  310. ESC-C        capword();        /* Initial capitalize word.    */
  311. ESC-D        delfword();        /* Delete forward word.        */
  312. ESC-DEL        delbword();        /* Delete backward word.    */
  313. ^K        mdeleln();        /* delete entire line from beginning */
  314. ESC-^K        mdelwln();        /* delete entire line including NL   */
  315. ESC-K        killsent();        /* kill sentence forward sets mark */
  316. ^W        killregion();        /* Kill region.            */
  317. ESC-W        copyregion();        /* Copy region to kill buffer.    */
  318. ^X-R        writereg();        /* write defined region to file */
  319.  
  320. SEARCHING
  321. ^S        forwsearch();        /* Search forward        */
  322. ^R        backsearch();        /* Search backwards        */
  323. ESC-R        replace();        /* Search and replace        */
  324. `^R or ESC-^T    backisearch();        /* Incremental search back    */
  325. `^S or ESC-^S    forwisearch();        /* Incremental search forward    */
  326. ^X-S        gospell();        /* Search for 0x93 (unix spell)    */
  327.  
  328. Function Key, Cursor Pad, and Numeric pad bindings.  The keycode associated
  329. with the primary EMACS binding for each of the rebound functions is sent
  330. over the serial line.  This allows you to set up your bindings at the ST to
  331. match those you normally use with the EMACS on a remote computer.
  332.  
  333. KEY        FUNCTION
  334. ===========================
  335. F1        setmark()
  336. F2        listbuffers()
  337. F3        filename()
  338. F4        writeregion()
  339. F5        fileinsert()
  340. F6        fileread()
  341. F7        filevisit()
  342. F8        filewrite()
  343. F9        filesave()
  344. F10        quickexit()
  345. Number pad    (bound to functions except when CapsLock is on)
  346. (        backword()
  347. )        forwword()
  348. /        grtw()
  349. *        retversion()
  350. 7        gotobol()
  351. 8        gotoeol()
  352. -        pageback()
  353. 4        backsent()
  354. 5        forwsent()
  355. +        pageforw()
  356. 1        gotbop()    /* beginning of paragraph */
  357. 2        goteop()    /* end of paragraph */
  358. 0        Control-X prefix
  359. .        forwdel()
  360. ENTER        indent()
  361. [All of the other number pad keys are bound to unkncom() (the unknown
  362. command function), but those can be rebound to something useful through a
  363. command file.]
  364. [The cursor pad cannot be rebound.  It would not be that difficult to add
  365. this feature to the source.]
  366. CURSORS        what they look like they should do
  367. INSERT        openline()
  368. UNDO        yank()
  369. HELP        kermit()    showhelp() in terminal mode
  370. CLR        refresh()
  371.  
  372. KERMIT (and subcommands)
  373. ^_ or HELP    kermit();        /* file transfer */
  374.  ________________
  375. | [The following subcommands are supported.  Only the first letter is
  376. |  significant.]
  377. |  send        send a file (in a uemail buffer) to remote kermit
  378. |  receive    receive a file from remote
  379. |  put        send a file in server mode
  380. |  get        recieve in server mode (uemail prompts for remote name)
  381. |  finish    finish remote kermit server mode
  382. |  bye        finish server and logoff remote
  383. |  transfer    send a uemail buffer to remote appending EOF to end
  384. |  emacs    same as above but without EOF
  385. |  log        copy remote session into a uemail buffer (`^\ turns it off)
  386. |  connect    connect to the RS232 line in terminal mode
  387. |  ^G        abort a kermit session (get, put, rec, send, fin, or bye)
  388. |        Use this if one of the commands appears to "lock up"
  389.  ================
  390. |  [Terminal mode commands.  Some are VAX specific.]
  391. |    ALT-CTRL-B    send break
  392. |    ALT-B        set baud rate (prompts for value)
  393. |    ALT-O        turn off handshaking
  394. |    ALT-R        use RTS/CTS handshaking
  395. |    ALT-T        show time on mode line
  396. |    ALT-X        use XON/XOFF handshaking
  397. |    ALT-?        show help information
  398. |    HELP        show help information
  399. |    ALT-UNDO    exit terminal mode (return to current uemail buffer)
  400. |    ALT-any-other    sends the character (i.e. NULL)
  401.  ----------------
  402.  
  403. MACROS
  404. ======
  405. ^X-(        ctlxlp();        /* Begin macro            */
  406. ^X-)        ctlxrp();        /* End macro            */
  407. ^X-E        ctlxe();        /* Execute macro        */
  408.  ________________
  409. | The following commands let you bind a macro that was defined using
  410. | ^X( to any keyboard key.  That macro can be executed using the accent
  411. | grave (putmacro) command.  The macros can be saved to disk and reloaded
  412. | when needed.]
  413.  ----------------
  414. ` (grave)    putmacro();        /* print line macros in text    */
  415. ^X`        getmacro();        /* bind current kbdm to key    */
  416. [The following macros are predefined and cannot be rebound.]
  417. `^G        abort
  418. `^L        load a file of previously defined macros
  419. `^M        write currently defined macros to file
  420. `^R        incremental search back
  421. `^S        incremental search forward
  422. `^T        show time on mode line
  423. `^X        write current keyboard macro in C code to
  424.                 C-Mac buffer (for programming extensions)
  425. `^W        view C-Mac buffer
  426. ``        insert an accent grave
  427.